<template>
  <div class="am-content">
    <div class="amc-toolbar">
      <el-button type="success" icon="el-icon-refresh" @click="refreshQuery">刷新</el-button>
    </div>
    <el-table border stripe :data="tableData" :header-cell-style="tableHeaderCellStyle">
      <el-table-column prop="roomId" label="房间号" align="center"/>
      <el-table-column prop="roomType" label="报警类型" align="center">
        <template slot-scope="scope">{{scope.row.roomType | roomTypeFilter}}</template>
      </el-table-column>
      <el-table-column prop="createrName" label="报警人" align="center"/>
      <el-table-column prop="createrId" label="报警人Id" align="center"/>
      <el-table-column prop="receiverName" label="接警员" align="center"/>
      <el-table-column prop="receiverId" label="接警员Id" align="center"/>
    </el-table>
    <el-pagination :current-page="curPage" :page-size="limit" layout="total, prev, pager, next" :total="total"
                   @size-change="handleSizeChange" @current-change="handleCurrentChange"
    />
  </div>
</template>

<script>
import pagination from "@/mixins/pagination";
import CommonStyle from "@/util/CommonStyle";
export default {
  name: "ManageTRTCRoom",
  mixins: [pagination],
  data() {
    return {
      tableHeaderCellStyle: CommonStyle.tableHeaderCellStyle,
      queryUrl: "/api-rtc/rtc/roomAlive"
    }
  },
  filters: {
    roomTypeFilter(roomType) {
      if (parseInt(roomType) === 0) {
        return "视频报警";
      } else if (parseInt(roomType) === 2) {
        return "事故快处";
      }else if (parseInt(roomType) === 3) {
        return "警用视频";
      } else {
        return "事故快处";
      }
    }
  },
  mounted() {
    this.queryData();
  },
  methods: {

  }
}
</script>

<style lang="scss" scoped>
@import "../../../styles/police-common.scss";
.amc-toolbar{
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  margin: 0px 0px 20px 0px;
}
</style>
